package com.example.demo.pojo;
import lombok.Data;
/**
 * @Author ShenTuZhiGang
 * @Version 1.0.0
 * @Date 2020-02-10 12:51
 */
@Data
public class RespBean {
    private Integer status;

    private String msg;

    private Object data;

    public static RespBean build() {
        return new RespBean();
    }

    public static RespBean ok(String msg) {
        return new RespBean(200, msg, null);
    }

    public static RespBean ok(String msg, Object obj) {
        return new RespBean(200, msg, obj);
    }

    public static RespBean error(String msg) {
        return new RespBean(500, msg, null);
    }

    public static RespBean error(String msg, Object obj) {
        return new RespBean(500, msg, obj);
    }

    private RespBean() {

    }

    private RespBean(Integer status, String msg, Object obj) {
        this.status = status;
        this.msg = msg;
        this.data = obj;
    }
}